<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <input type="text">
    <script>
        // input事件
        // const inp = document.querySelector('[type="text"]')
        // inp.addEventListener('input', () => {
        //     console.log(inp.value);
        // })
        // 键盘事件 
        const inp = document.querySelector('[type="text"]')
        inp.addEventListener('keydown', () => {
            console.log('我按下了');
        })
        inp.addEventListener('keyup', () => {
            console.log('我抬起来了');
        })

    </script>
</body>

</html>